import React from 'react';

import { setDocumentTitle } from  '../../components/utils';

import Table from '../../../../components/table/Table.jsx';

import Pagination from '../../../../components/pagination/Pagination.jsx'

export default class TablePage extends React.Component {
  constructor(props){
    super(props);
    setDocumentTitle('Table');
  }

  columns(){
    return [{
      key: 'area',
      title: '地区',
      width: '',
      className: '',
      align: '',
      colSpan: '',
      // render(item){}
    }, {
      key: 'name',
      title: '名称',
    }, {
      key: 'category',
      title: '类型',
    }, {
      dataIndex: 'remark.txt',
      title: '备注',
      editable: true,
      onBlur: (value)=>{
        console.log(value)
      }
    }, {
      dataIndex: 'remark.time',
      title: '备注修改时间',
      align: 'center',
    }, {
      key: 'nearest',
      title: '最近爬取时间',
      align: 'center',
    }, {
      key: 'bad',
      title: '状态',
    }, {
      key: 'on',
      title: '开关',
    }, {
      key: '',
      title: '操作',
      render(){
        return '操作'
      }
    }]
  }

  dataSource() {
    return [{
      "category": "paper",
      "index": 1,
      "remark": {"txt": "", "time": ""},
      "name": "\u6d59\u6c5f\u65e5\u62a5",
      "on": 1,
      "url": "http://zjrb.zjol.com.cn/",
      "area": "\u6d59\u6c5f",
      "nearest": "2018-10-12 06:49:39",
      "bad": 0,
      "id": 335
    }, {
      "category": "paper",
      "index": 2,
      "remark": {"txt": "", "time": ""},
      "name": "\u94b1\u6c5f\u665a\u62a5",
      "on": 1,
      "url": "http://qjwb.zjol.com.cn/",
      "area": "\u6d59\u6c5f",
      "nearest": "2018-10-12 06:50:52",
      "bad": 0,
      "id": 336
    }, {
      "category": "paper",
      "index": 3,
      "remark": {"txt": "", "time": ""},
      "name": "\u676d\u5dde\u65e5\u62a5",
      "on": 1,
      "url": "http://hzdaily.hangzhou.com.cn/hzrb/",
      "area": "\u6d59\u6c5f",
      "nearest": "2018-10-12 04:38:45",
      "bad": 0,
      "id": 337
    }, {
      "category": "paper",
      "index": 4,
      "remark": {"txt": "", "time": ""},
      "name": "\u90fd\u5e02\u5feb\u62a5",
      "on": 1,
      "url": "http://hzdaily.hangzhou.com.cn/dskb/",
      "area": "\u6d59\u6c5f",
      "nearest": "2018-10-11 10:39:43",
      "bad": 0,
      "id": 338
    }, {
      "category": "paper",
      "index": 5,
      "remark": {"txt": "", "time": ""},
      "name": "\u6bcf\u65e5\u5546\u62a5",
      "on": 1,
      "url": "http://hzdaily.hangzhou.com.cn/mrsb/",
      "area": "\u6d59\u6c5f",
      "nearest": "2018-10-11 10:42:08",
      "bad": 0,
      "id": 339
    }, {
      "category": "paper",
      "index": 6,
      "remark": {"txt": "", "time": ""},
      "name": "\u5b81\u6ce2\u65e5\u62a5",
      "on": 1,
      "url": "http://daily.cnnb.com.cn/nbrb/",
      "area": "\u6d59\u6c5f",
      "nearest": "2018-10-12 06:51:16",
      "bad": 0,
      "id": 340
    }, {
      "category": "paper",
      "index": 7,
      "remark": {"txt": "", "time": ""},
      "name": "\u5b81\u6ce2\u665a\u62a5",
      "on": 1,
      "url": "http://daily.cnnb.com.cn/nbwb/",
      "area": "\u6d59\u6c5f",
      "nearest": "2018-10-12 06:51:53",
      "bad": 0,
      "id": 341
    }, {
      "category": "paper",
      "index": 8,
      "remark": {"txt": "\u5468\u62a5\uff0c\u4e00\u5468\u66f4\u65b0\u4e00\u6b21", "time": "2018-07-19 13:32:48"},
      "name": "\u4e1c\u5357\u5546\u62a5",
      "on": 1,
      "url": "http://daily.cnnb.com.cn/dnsb/",
      "area": "\u6d59\u6c5f",
      "nearest": "2018-09-28 12:07:48",
      "bad": 1,
      "id": 342
    }, {
      "category": "paper",
      "index": 9,
      "remark": {"txt": "", "time": ""},
      "name": "\u5609\u5174\u65e5\u62a5",
      "on": 1,
      "url": "http://jxrb.cnjxol.com/",
      "area": "\u6d59\u6c5f",
      "nearest": "2018-10-12 06:52:48",
      "bad": 0,
      "id": 347
    }, {
      "category": "paper",
      "index": 10,
      "remark": {"txt": "", "time": ""},
      "name": "\u6e56\u5dde\u65e5\u62a5",
      "on": 1,
      "url": "http://ehzrb.hz66.com/hzrb/",
      "area": "\u6d59\u6c5f",
      "nearest": "2018-10-12 04:45:08",
      "bad": 0,
      "id": 348
    }, {
      "category": "paper",
      "index": 11,
      "remark": {"txt": "", "time": ""},
      "name": "\u91d1\u534e\u65e5\u62a5",
      "on": 1,
      "url": "http://epaper.jhnews.com.cn/site1/jhrb/paperindex.htm",
      "area": "\u6d59\u6c5f",
      "nearest": "2018-10-12 04:43:32",
      "bad": 0,
      "id": 351
    }, {
      "category": "paper",
      "index": 12,
      "remark": {"txt": "", "time": ""},
      "name": "\u8862\u5dde\u65e5\u62a5",
      "on": 1,
      "url": "http://qzrb.qz828.com/qzrb/",
      "area": "\u6d59\u6c5f",
      "nearest": "2018-10-12 06:53:09",
      "bad": 0,
      "id": 352
    }, {
      "category": "paper",
      "index": 13,
      "remark": {"txt": "", "time": ""},
      "name": "\u8862\u5dde\u665a\u62a5",
      "on": 1,
      "url": "http://qzrb.qz828.com/qzwb/",
      "area": "\u6d59\u6c5f",
      "nearest": "2018-10-11 23:47:32",
      "bad": 0,
      "id": 353
    }, {
      "category": "paper",
      "index": 14,
      "remark": {"txt": "", "time": ""},
      "name": "\u4e3d\u6c34\u65e5\u62a5",
      "on": 1,
      "url": "http://epaper.lsnews.com.cn/lsrb/",
      "area": "\u6d59\u6c5f",
      "nearest": "2018-10-11 11:50:57",
      "bad": 0,
      "id": 355
    }, {
      "category": "paper",
      "index": 15,
      "remark": {"txt": "", "time": ""},
      "name": "\u53f0\u5dde\u65e5\u62a5",
      "on": 1,
      "url": "http://paper.taizhou.com.cn/tzrb/paperindex.htm",
      "area": "\u6d59\u6c5f",
      "nearest": "2018-10-12 04:43:57",
      "bad": 0,
      "id": 356
    }, {
      "category": "paper",
      "index": 16,
      "remark": {"txt": "", "time": ""},
      "name": "\u53f0\u5dde\u665a\u62a5",
      "on": 1,
      "url": "http://paper.taizhou.com.cn/tzwb/paperindex.htm",
      "area": "\u6d59\u6c5f",
      "nearest": "2018-10-12 04:44:30",
      "bad": 0,
      "id": 357
    }, {
      "category": "paper",
      "index": 17,
      "remark": {"txt": "2018\u5e741\u67081\u65e5\u8d77\u4f11\u520a", "time": "2018-07-18 11:10:50"},
      "name": "\u53f0\u5dde\u5546\u62a5",
      "on": 0,
      "url": "http://paper.taizhou.com.cn/tzsb/paperindex.htm",
      "area": "\u6d59\u6c5f",
      "nearest": "",
      "bad": 1,
      "id": 358
    }, {
      "category": "paper",
      "index": 18,
      "remark": {"txt": "", "time": ""},
      "name": "\u6148\u6eaa\u65e5\u62a5",
      "on": 1,
      "url": "http://epaper.cxnews.cn/",
      "area": "\u6d59\u6c5f",
      "nearest": "2018-10-11 23:48:06",
      "bad": 0,
      "id": 359
    }, {
      "category": "paper",
      "index": 19,
      "remark": {"txt": "", "time": ""},
      "name": "\u5949\u5316\u65e5\u62a5",
      "on": 1,
      "url": "http://daily.cnnb.com.cn/fhrb/paperindex.htm",
      "area": "\u6d59\u6c5f",
      "nearest": "2018-10-12 04:45:03",
      "bad": 0,
      "id": 360
    }, {
      "category": "paper",
      "index": 20,
      "remark": {"txt": "", "time": ""},
      "name": "\u4f59\u59da\u65e5\u62a5",
      "on": 1,
      "url": "http://cnepaper.com/yyrb",
      "area": "\u6d59\u6c5f",
      "nearest": "2018-10-12 04:45:27",
      "bad": 0,
      "id": 361
    }, {
      "category": "paper",
      "index": 21,
      "remark": {"txt": "", "time": ""},
      "name": "\u911e\u5dde\u65e5\u62a5",
      "on": 1,
      "url": "http://www.cnepaper.com/yzrb/",
      "area": "\u6d59\u6c5f",
      "nearest": "2018-10-12 06:54:45",
      "bad": 0,
      "id": 362
    }, {
      "category": "paper",
      "index": 22,
      "remark": {"txt": "", "time": ""},
      "name": "\u4f59\u676d\u6668\u62a5",
      "on": 1,
      "url": "http://yhcb.eyh.cn/",
      "area": "\u6d59\u6c5f",
      "nearest": "2018-10-11 11:52:02",
      "bad": 0,
      "id": 363
    }, {
      "category": "paper",
      "index": 23,
      "remark": {"txt": "", "time": ""},
      "name": "\u8427\u5c71\u65e5\u62a5",
      "on": 1,
      "url": "http://xsrb.xsnet.cn/epaper/",
      "area": "\u6d59\u6c5f",
      "nearest": "2018-10-11 23:48:56",
      "bad": 0,
      "id": 364
    }, {
      "category": "paper",
      "index": 24,
      "remark": {"txt": "", "time": ""},
      "name": "\u4e49\u4e4c\u5546\u62a5",
      "on": 1,
      "url": "http://www.ywnews.cn/",
      "area": "\u6d59\u6c5f",
      "nearest": "2018-10-11 23:49:12",
      "bad": 0,
      "id": 365
    }, {
      "category": "paper",
      "index": 25,
      "remark": {"txt": "", "time": ""},
      "name": "\u67ef\u6865\u65e5\u62a5",
      "on": 1,
      "url": "http://epaper.zgkqw.com/",
      "area": "\u6d59\u6c5f",
      "nearest": "2018-10-12 06:55:36",
      "bad": 0,
      "id": 367
    }, {
      "category": "paper",
      "index": 26,
      "remark": {"txt": "", "time": ""},
      "name": "\u6c38\u5eb7\u65e5\u62a5",
      "on": 1,
      "url": "http://paper.lifeyk.com/",
      "area": "\u6d59\u6c5f",
      "nearest": "2018-10-11 10:44:04",
      "bad": 0,
      "id": 369
    }, {
      "category": "paper",
      "index": 27,
      "remark": {"txt": "", "time": ""},
      "name": "\u4e1c\u9633\u65e5\u62a5",
      "on": 1,
      "url": "http://dyrb.zjol.com.cn/",
      "area": "\u6d59\u6c5f",
      "nearest": "2018-10-12 04:46:06",
      "bad": 0,
      "id": 370
    }, {
      "category": "paper",
      "index": 28,
      "remark": {"txt": "", "time": ""},
      "name": "\u5bcc\u9633\u65e5\u62a5",
      "on": 1,
      "url": "http://fydaily.fynews.com.cn/",
      "area": "\u6d59\u6c5f",
      "nearest": "2018-10-11 11:53:29",
      "bad": 0,
      "id": 372
    }, {
      "category": "paper",
      "index": 29,
      "remark": {"txt": "", "time": ""},
      "name": "\u6d77\u5b81\u65e5\u62a5",
      "on": 1,
      "url": "http://hnrb.zjol.com.cn/hnrb/",
      "area": "\u6d59\u6c5f",
      "nearest": "2018-10-12 04:46:32",
      "bad": 0,
      "id": 373
    }, {
      "category": "paper",
      "index": 30,
      "remark": {"txt": "", "time": ""},
      "name": "\u6e29\u5cad\u65e5\u62a5",
      "on": 1,
      "url": "http://wldaily.zjol.com.cn/",
      "area": "\u6d59\u6c5f",
      "nearest": "2018-10-11 11:53:46",
      "bad": 0,
      "id": 374
    }, {
      "category": "paper",
      "index": 31,
      "remark": {"txt": "", "time": ""},
      "name": "\u4eca\u65e5\u5b81\u6d77",
      "on": 1,
      "url": "http://epaper.routeryun.com/jrnh",
      "area": "\u6d59\u6c5f",
      "nearest": "2018-10-11 23:50:04",
      "bad": 0,
      "id": 375
    }, {
      "category": "paper",
      "index": 32,
      "remark": {"txt": "", "time": ""},
      "name": "\u4eca\u65e5\u6b66\u4e49",
      "on": 1,
      "url": "http://jrwy.zjol.com.cn/",
      "area": "\u6d59\u6c5f",
      "nearest": "2018-10-11 11:53:55",
      "bad": 0,
      "id": 376
    }, {
      "category": "paper",
      "index": 33,
      "remark": {"txt": "", "time": ""},
      "name": "\u9752\u5e74\u65f6\u62a5",
      "on": 1,
      "url": "http://www.qnsb.com/fzepaper/",
      "area": "\u6d59\u6c5f",
      "nearest": "2018-10-12 06:56:39",
      "bad": 0,
      "id": 377
    }, {
      "category": "paper",
      "index": 34,
      "remark": {"txt": "", "time": ""},
      "name": "\u6d59\u6c5f\u6cd5\u5236\u62a5",
      "on": 1,
      "url": "http://zjfzb.zjol.com.cn/",
      "area": "\u6d59\u6c5f",
      "nearest": "2018-10-12 06:56:58",
      "bad": 0,
      "id": 378
    }, {
      "category": "paper",
      "index": 35,
      "remark": {"txt": "", "time": ""},
      "name": "\u6d59\u6c5f\u5de5\u4eba\u62a5",
      "on": 1,
      "url": "http://epaper.zjgrrb.com/",
      "area": "\u6d59\u6c5f",
      "nearest": "2018-10-12 06:57:11",
      "bad": 0,
      "id": 379
    }, {
      "category": "paper",
      "index": 36,
      "remark": {"txt": "", "time": ""},
      "name": "\u4eca\u65e5\u8c61\u5c71",
      "on": 1,
      "url": "http://dzb.cnxsg.cn/",
      "area": "\u6d59\u6c5f",
      "nearest": "2018-10-11 23:51:17",
      "bad": 0,
      "id": 380
    }, {
      "category": "paper",
      "index": 37,
      "remark": {"txt": "", "time": ""},
      "name": "\u65b0\u6c5f\u5317",
      "on": 1,
      "url": "http://www.cnepaper.com/xjbb/",
      "area": "\u6d59\u6c5f",
      "nearest": "2018-10-10 11:21:57",
      "bad": 0,
      "id": 381
    }, {
      "category": "paper",
      "index": 38,
      "remark": {"txt": "", "time": ""},
      "name": "\u4f53\u575b\u62a5",
      "on": 1,
      "url": "http://www.zjhaodong.com:808/",
      "area": "\u6d59\u6c5f",
      "nearest": "2018-10-11 11:43:53",
      "bad": 0,
      "id": 382
    }]
  }

  render() {
    let dataSource = this.dataSource(),
      columns = this.columns();
    return <div className={`table-page`}>
      <Table
        // loading
        hasOrder
        bordered
        showHeader
        pagination={{position: 'top', total: dataSource.length}}
        footer={()=>'This is footer'}
        dataSource={dataSource}
        columns={columns}
      />
    </div>
  }
}